﻿@using Kugar.Core.Configuration
@using Kugar.Core.Web
@using Kugar.UI.Web.AdminLTE
@using Kugar.UI.Web.AdminLTE.Enums
@using Kugar.UI.Web.AdminLTE.Helpers
@using Kugar.UI.Web.AdminLTE.Helpers.FormExtMethod
@using Kugar.UI.Web.AdminLTE.PageControls.Helpers.ButtonExtMethod

@inject AdminLTEUI WebUI

@{
    if (ViewContext.HttpContext.Request.GetBool("IsIFrame", false))
    {
        Layout = AdminLTEUI.LayoutPath.LayoutWithIFramePath_Content;
    }
    else
    {
        var configLayout = CustomConfigManager.Default["AdminLTE:AdminManagerLayout"];

        if (!string.IsNullOrWhiteSpace(configLayout))
        {
            Layout = configLayout;
        }
        else
        {
            Layout = AdminLTEUI.LayoutPath.DefaultLayoutPath;
        }
    }

    WebUI.Title = "修改密码";
    WebUI.CurrentMenuKey = CustomConfigManager.Default["AdminLTE:AdminPasswordCurrentMenuKey"];
}

@using (var frm = WebUI.Control.Form().WithBox().Post().Render())
{
    @frm.AddTextBox().Label("旧密码").SelectedOnClick().Name("OldPassword").Render()

    @frm.AddTextBox().Label("新密码").SelectedOnClick().Name("NewPassword").Render()

    @frm.AddTextBox().Label("确认密码").SelectedOnClick().Name("ConfirmPassword").Render()

    frm.AddButtonList()
        .AddButton(x => x.Text("保存").DisabledAfterClick().Type(ButtonTypeEnum.submit).Color(ColorPaletteEnum.success))
        .Render();
}